home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++)))) RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWFactory - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- typedef unsigned short RWClassID;
-
-
-
- typedef RWCollectable* (*RWuserCreator)();
- #include <rw/factory.h>
- RWFactory* theFactory;
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- Class RRRRWWWWFFFFaaaaccccttttoooorrrryyyy can create an instance of an RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee object, given
- a class ID. It does this by maintaining a table of class IDs and
- associated "creator functions." A creator function has prototype:
-
- RWCollectable* aaaaCCCCrrrreeeeaaaattttoooorrrrFFFFuuuunnnnccccttttiiiioooonnnn();
-
-
-
-
-
- This function should create an instance of a particular class. For a
- given RRRRWWWWCCCCllllaaaassssssssIIIIDDDD tag, the appropriate function is selected, invoked and
- the resultant pointer returned. Because any object created this way is
- created off the heap, you are responsible for deleting it when done.
- There is a one-of-a-kind global RRRRWWWWFFFFaaaaccccttttoooorrrryyyy which can be accessed using
- ggggeeeettttRRRRWWWWFFFFaaaaccccttttoooorrrryyyy. It is guaranteed to have creator functions in it for all
- of the classes referenced by your program. See also the section in the
- User's Guide about RRRRWWWWFFFFaaaaccccttttoooorrrryyyy.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- EEEExxxxaaaammmmpppplllleeee
- #include <rw/factory.h>
- #include <rw/rwbag.h>
- #include <rw/colldate.h>
- #include <rw/rstream.h>
- main(){
- // Create new RWBag off the heap, using Class ID __RWBAG.
- RWBag* b = (RWBag*)getRWFactory ()->create(__RWBAG);
- b->insert( new RWCollectableDate ); // Insert today's date
- // ...
- b->clearAndDestroy(); // Cleanup: first delete members,
- delete b; // then the bag itself
- }
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++)))) RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++))))
-
-
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- RRRRWWWWFFFFaaaaccccttttoooorrrryyyy();
-
-
- Construct an RRRRWWWWFFFFaaaaccccttttoooorrrryyyy.
-
- PPPPuuuubbbblllliiiicccc OOOOppppeeeerrrraaaattttoooorrrr
- RWBoolean
- ooooppppeeeerrrraaaattttoooorrrr<<<<====(const RWFactory& h);
-
-
- Returns TTTTRRRRUUUUEEEE if self is a subset of hhhh, that is, every element of self
- has a counterpart in hhhh which iiiissssEEEEqqqquuuuaaaallll. This operator is included to fix
- an inconsistency in the C++ language. It is not explicitly present
- unless you are compiling with an implementation of the Standard C++
- Library. It would normally be inherited from RRRRWWWWSSSSeeeetttt NNNNooootttteeee: If you
- inherit from RRRRWWWWFFFFaaaaccccttttoooorrrryyyy in the presence of the Standard C++ Library, we
- recommend that you override this operator and explicitly forward the
- call. Overload resolution in C++ will choose the Standard Library
- provided global operators over inherited class members. These global
- definitions are not appropriate for set-like partial orderings.
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- void
- aaaaddddddddFFFFuuuunnnnccccttttiiiioooonnnn(RWuserCreator uc, RWClassID id);
-
-
- Adds to the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy the global function pointed to by uuuucccc, which creates
- an instance of an object with RRRRWWWWCCCCllllaaaassssssssIIIIDDDD iiiidddd.
-
- void
- aaaaddddddddFFFFuuuunnnnccccttttiiiioooonnnn(RWuserCreator uc, RWClassID id, RWStringID sid);
-
-
- Adds to the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy the global function pointed to by uuuucccc, which creates
- an instance of an object with RRRRWWWWCCCCllllaaaassssssssIIIIDDDD iiiidddd and RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD ssssiiiidddd.
-
- RWCollectable*
- ccccrrrreeeeaaaatttteeee(RWClassID id) const;
-
-
- Allocates a new instance of the class with RRRRWWWWCCCCllllaaaassssssssIIIIDDDD iiiidddd off the heap and
- returns a pointer to it. Returns nnnniiiillll if iiiidddd does not exist. Because this
- instance is allocated ooooffffffff tttthhhheeee hhhheeeeaaaapppp, you are responsible for deleting it
- when done.
-
- RWCollectable*
- ccccrrrreeeeaaaatttteeee(RWString sid) const;
-
-
- Allocates a new instance of the class with RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD ssssiiiidddd off the heap
- and returns a pointer to it. Returns nnnniiiillll if ssssiiiidddd does not exist. Because
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++)))) RRRRWWWWFFFFaaaaccccttttoooorrrryyyy((((3333CCCC++++++++))))
-
-
-
- this instance is allocated ooooffffffff tttthhhheeee hhhheeeeaaaapppp, you are responsible for deleting
- it when done.
-
- RWuserCreator
- ggggeeeettttFFFFuuuunnnnccccttttiiiioooonnnn(RWClassID id) const;
-
-
- Returns from the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy a pointer to the global function associated
- with RRRRWWWWCCCCllllaaaassssssssIIIIDDDD iiiidddd. Returns nnnniiiillll if iiiidddd does not exist.
-
- RWuserCreator
- ggggeeeettttFFFFuuuunnnnccccttttiiiioooonnnn(RWStringID sid) const;
-
-
- Returns from the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy a pointer to the global function associated
- with RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD ssssiiiidddd. Returns nnnniiiillll if ssssiiiidddd does not exist.
-
- void
- rrrreeeemmmmoooovvvveeeeFFFFuuuunnnnccccttttiiiioooonnnn(RWClassID id);
-
-
- Removes from the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy the global function associated with RRRRWWWWCCCCllllaaaassssssssIIIIDDDD
- iiiidddd. If iiiidddd does not exist in the factory, no action is taken.
-
- void
- rrrreeeemmmmoooovvvveeeeFFFFuuuunnnnccccttttiiiioooonnnn(RWStringID sid);
-
-
- Removes from the RRRRWWWWFFFFaaaaccccttttoooorrrryyyy the global function associated with RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD
- ssssiiiidddd. If ssssiiiidddd does not exist in the factory, no action is taken.
-
- RWStringID
- ssssttttrrrriiiinnnnggggIIIIDDDD(RWClassID id) const;
-
-
- Looks up the RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD associated with iiiidddd and returns it. If there is
- no such association, returns RRRRWWWWSSSSttttrrrriiiinnnnggggIIIIDDDD((((""""NNNNooooIIIIDDDD"""")))).
-
- RWClassID
- ccccllllaaaassssssssIIIIDDDD(RWStringID) const;
-
-
- Looks up the RRRRWWWWCCCCllllaaaassssssssIIIIDDDD associated with ssssiiiidddd and returns it. If there is
- no such association, returns ________RRRRWWWWUUUUNNNNKKKKNNNNOOOOWWWWNNNN.
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-